package com.mocha.util;

import org.slf4j.helpers.FormattingTuple;
import org.slf4j.helpers.MessageFormatter;

public class StringUtil {

    public static String format(String message, Object... objects) {
        if (message == null) {
            return message;
        }else if (objects.length == 0) {
            return message;
        }else {
            FormattingTuple formattingTuple = MessageFormatter.format(message, objects);
            return formattingTuple.getMessage();
        }
    }
}
